﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<skags.Models.ArticleCategory>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Greinaflokkar
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<div id="navigation">
<% Html.RenderPartial("AdminNavigation"); %>
</div>
<div id="content">
    <h2>Greinaflokkar</h2>
    <table>
        <tr>
            <td><a href="/Admin/CreateArticleCategory"><img src="../../Content/icons/create.png" alt="Nýr greinaflokkur" /></a></td>
            <th>
                ID
            </th>
            <th>
                Titill
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <a href="/Admin/DeleteArticleCategory/<%= item.ID %>" onclick="return confirm('Ertu viss um að þú viljir eyða þessum flokk og öllum greinum í honum?')"><img src="../../Content/icons/delete.png" alt="Eyða" /></a>
                &nbsp;
                <a href="/Admin/EditArticleCategory/<%= item.ID %>"><img src="../../Content/icons/edit.png" alt="Breyta" /></a>
            </td>
            <td>
                <%: item.ID %>
            </td>
            <td>
                <%: item.Title %>
            </td>
        </tr>
    <% } %>

    </table>
</div>
</asp:Content>
